home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / game / patch / WHDIGamesC-D.lzh / CastleWarrior.lha / CastleWarriorHd / Install < prev    next >
Text File  |  2001-09-02  |  3KB  |  143 lines

  1. ;****************************
  2.  
  3. (set #sub-dir "data")      ;sub directory containing data files
  4. (set #readme-file "Readme")  ;name of readme file
  5. (set #cleanup "")    ;files to delete after install
  6.  
  7. ;****************************
  8.  
  9. ;----------------------------
  10. ; Checks if given program is reachable via the path
  11. ; if not abort install
  12. ; IN:  #program - to check
  13. ; OUT: -
  14.  
  15. (procedure P_chkrun
  16.   (if
  17.     (= 0 (run ("cd SYS:\nWhich %s" #program)))
  18.     ("")
  19.     (abort ("You must install \"%s\" first !\nIt must be accessible via the path.\nYou can find it in the whdload package." #program))
  20.   )
  21. )
  22.  
  23. ;----------------------------
  24. ; Wait for inserting disk
  25. ; IN:  #AD_disk - name of disk
  26. ; OUT: -
  27.  
  28.  
  29. ;****************************
  30.  
  31. (if
  32.   (exists #readme-file)
  33.   (if 
  34.     (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  35.     ("")
  36.     (run ("SYS:Utilities/More %s" #readme-file))
  37.   )
  38. )
  39.  
  40. (set #program "WHDLoad")
  41. (P_chkrun)
  42.  
  43. (set @default-dest
  44.   (askdir
  45.     (prompt ("Where should \"%s\" installed ?\nA drawer \"%s\" will automatically created." @app-name @app-name))
  46.     (help @askdir-help)
  47.     (default @default-dest)
  48.     (disk)
  49.   )
  50. )
  51. (set #dest (tackon @default-dest @app-name))
  52. (if
  53.   (exists #dest)
  54.   (
  55.     (set #choice
  56.       (askbool
  57.         (prompt ("\nDirectory \"%s\" already exists.\n Should it be deleted ?" #dest))
  58.         (default 1)
  59.         (choices "Delete" "Skip")
  60.         (help @askbool-help)
  61.       )
  62.     )
  63.     (if
  64.       (= #choice 1)
  65.       (run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
  66.     )
  67.   )
  68. )
  69. (makedir #dest
  70.   (help @makedir-help)
  71.   (infos)
  72. )
  73.  
  74. ;----------------------------
  75.  
  76. (copyfiles
  77.   (help @copyfiles-help)
  78.   (source ("%s.slave" @app-name))
  79.   (dest #dest)
  80. )
  81. (if
  82.   (exists ("%s.glowicon" @app-name))
  83.   (set #icon
  84.     (askchoice
  85.       (prompt "\nWhich icon do you like to install ?\n")
  86.       (default 0)
  87.       (choices "Normal" "glowicon")
  88.       (help @askchoice-help)
  89.     )
  90.   )
  91.   (set #icon 0)
  92. )
  93. (select #icon
  94.   (set #icon ("%s.inf" @app-name))
  95.   (set #icon ("%s.glowicon" @app-name))
  96. )
  97. (copyfiles
  98.   (help @copyfiles-help)
  99.   (source #icon)
  100.   (newname ("%s.info" @app-name))
  101.   (dest #dest)
  102. )
  103. (if
  104.   (exists #readme-file)
  105.   (copyfiles
  106.     (help @copyfiles-help)
  107.     (source #readme-file)
  108.     (dest #dest)
  109.   )
  110. )
  111. (if
  112.   (exists ("%s.info" #readme-file))
  113.   (copyfiles
  114.     (help @copyfiles-help)
  115.     (source ("%s.info" #readme-file))
  116.     (dest #dest)
  117.   )
  118. )
  119.  
  120. (if
  121.   (= #sub-dir "")
  122.   ("")
  123.   (
  124.     (set #dest (tackon #dest #sub-dir))
  125.     (makedir #dest
  126.       (help @makedir-help)
  127.     )
  128.   )
  129. )
  130.  
  131. ;----------------------------
  132.  
  133. (message "Insert Castle Warrior Original disk in drive DF0.")
  134.  
  135. (copyfiles
  136.   (help @copyfiles-help)
  137.   (source ("castle:"))
  138.   (dest #dest)
  139.   (all)
  140. )
  141.  
  142. (exit)
  143.